<?xml version="1.0" encoding="UTF-8"?>
<ui:composition template="/pages/mastertemplate/MasterPage.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
	<ui:define name="content">
		<h:form>
			<h:panelGrid columns="3" style="margin-bottom:15px" cellpadding="1">

				<p:outputLabel style="margin: 0px 20px" value="#{msg.timkiemdonHang}" />
				<p:selectOneMenu style="margin-right:20px"
					value="#{DoiSoatBean.soChungTu}" filter="true">
					<f:selectItems value="#{DoiSoatBean.listDonHang}" var="selectItem"
						itemLabel="#{selectItem.soChungTu}"
						itemValue="#{selectItem.soChungTu}" />
				</p:selectOneMenu>
				<p:commandButton value="#{msg.timkiem}"
					action="#{DoiSoatBean.timKiemDonHang}"
					style="margin-bottom:5px;padding-top:-5px" update=" :DonHang"></p:commandButton>
			</h:panelGrid>
		</h:form>
		
		<h:form id="DonHang">
			<h:panelGrid columns="5" style="margin-bottom:15px;margin-left:40%" cellpadding="1">

				<p:outputLabel style="margin: 0px 20px" value="#{msg.hoaDon}" />
				<p:selectOneMenu 
					value="" filter="true">
					<f:selectItems value="#{DoiSoatBean.soHoaDon}" var="selectItem"
						itemLabel="#{selectItem}"
						itemValue="#{selectItem}" />
				</p:selectOneMenu>
				<div style="float:right">
				<p:outputLabel style="margin-left:200px;margin-right:20px ;float:right " value="#{msg.sochungtu}" />
				<p:selectOneMenu style="padding-right:0px"
					value="" filter="true">
					<f:selectItems value="#{DoiSoatBean.soPNX}" var="selectItem"
						itemLabel="#{selectItem}"
						itemValue="#{selectItem}" />
				</p:selectOneMenu>
			</div>
			</h:panelGrid>	

			<p:dataTable id="dataTableChiTietDonHang" var="chiTietDonHang"
				value="#{DoiSoatBean.chiTietDonHangs}" paginator="true" rows="10"
				paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
				rowsPerPageTemplate="10,20,50,100" style="width: 33%;float:left">

				<f:facet name="header">
					<h:outputText value="#{msg.ChiTietDonHang}"
						styleClass="tableHeader" />
				</f:facet>

				<p:column headerText="#{msg.maVatTu}">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{chiTietDonHang.vatTuHangHoa}" />
						</f:facet>
						<f:facet name="input">
							<p:inputText value="#{chiTietDonHang.vatTuHangHoa}" />
						</f:facet>
					</p:cellEditor>
				</p:column>
				<p:column headerText="#{msg.soLuong}">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{chiTietDonHang.soLuong}" />
						</f:facet>
						<f:facet name="input">
							<p:inputText value="#{chiTietDonHang.soLuong}" />
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="#{msg.donGia}">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{chiTietDonHang.donGia}">
								<f:convertNumber minIntegerDigits="1" />
							</h:outputText>
						</f:facet>
						<f:facet name="input">
							<p:inputText value="#{chiTietDonHang.donGia}" />
						</f:facet>
					</p:cellEditor>
				</p:column>
			</p:dataTable>
			<p:dataTable id="n" var="chiTietHoaDon"
				value="#{DoiSoatBean.chiTietHoaDons}" paginator="true" rows="10"
				paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
				rowsPerPageTemplate="10,20,50,100" style="width: 33%;float:left">
				<f:facet name="header">
					<h:outputText value="#{msg.ctHoaDon}" styleClass="tableHeader" />
				</f:facet>
				<p:column headerText="#{msg.maVatTu}">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{chiTietHoaDon[0]}" />
						</f:facet>
						<f:facet name="input">
							<p:inputText value="#{chiTietHoaDon[0]}" />
						</f:facet>
					</p:cellEditor>
				</p:column>
				<p:column headerText="#{msg.soLuong}">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{chiTietHoaDon[1]}" />
						</f:facet>
						<f:facet name="input">
							<p:inputText value="#{chiTietHoaDon[1]}" />
						</f:facet>
					</p:cellEditor>
				</p:column>
				<p:column headerText="#{msg.donGia}">
					<h:outputText value="#{chiTietHoaDon[2]}">
						<f:convertNumber minIntegerDigits="1" />
					</h:outputText>

				</p:column>
			</p:dataTable>
			<p:dataTable id="e" var="chiTietPhieuNhapXuat" value="#{DoiSoatBean.chiTietPhieuNhapXuats}"
				paginator="true" rows="10"
				paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
				rowsPerPageTemplate="10,20,50,100" style="width: 33%;float:left">
				<f:facet name="header">
					<h:outputText value="#{msg.ctPNX}" styleClass="tableHeader" />
				</f:facet>
				<p:column headerText="#{msg.maVatTu}">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{chiTietPhieuNhapXuat[0]}" />
						</f:facet>
						<f:facet name="input">
							<p:inputText value="#{chiTietPhieuNhapXuat[0]}" />
						</f:facet>
					</p:cellEditor>
				</p:column>
				<p:column headerText="#{msg.soLuong}">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{chiTietPhieuNhapXuat[1]}" />
						</f:facet>
						<f:facet name="input">
							<p:inputText value="#{chiTietPhieuNhapXuat[1]}" />
						</f:facet>
					</p:cellEditor>
				</p:column>
				
			</p:dataTable>
		</h:form>

	</ui:define>

</ui:composition>
